home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / dpmi_lib.zip / DPMI.H < prev    next >
Text File  |  1991-11-06  |  2KB  |  70 lines

  1. /* This file is DPMI.H
  2. ** Copyright (c) Rainer Schnitker 10/91
  3. */
  4. typedef unsigned char BYTE;
  5. typedef unsigned short WORD;
  6. typedef unsigned long DWORD;
  7. typedef struct {
  8.                 WORD lim_lo,base_lo;
  9.                 BYTE base_mi,access;
  10.                 BYTE lim_hi,base_hi;
  11.                 } DESCRIPTOR ;
  12. typedef struct {
  13.         WORD limit,lo,hi ;
  14.            } GDTR ;
  15. typedef struct {
  16.         WORD off_lo;
  17.         WORD sel;
  18.         BYTE count;
  19.         BYTE type;
  20.         WORD off_hi;
  21.         } GATE;
  22. typedef struct { DWORD i1,i2,i3,i4,i5,i6,i7,i8,i9,r1,r2,r3 ;} 
  23.         FREEMEMINFO;
  24.  
  25. #define DPMI(function)  { _AX = function ; asm int 31h ; }
  26.  
  27. void real_to_protected(void);
  28. void protected_to_real(void);
  29. WORD AllocLDT(WORD);
  30. int FreeLDT(WORD);
  31. WORD SegtoSel(WORD);
  32. WORD SelInc(void);
  33. int LockSel(WORD);
  34. int UnlockSel(WORD);
  35. DWORD GetBaseAddress(WORD);
  36. int SetBaseAddress(WORD,DWORD);
  37. int SetLimit(WORD sel,DWORD);
  38. int SetAccess(WORD,BYTE,BYTE);
  39. WORD CreatAlias(WORD);
  40. int AllocSpecialLDT(WORD);
  41. int GetDescriptor(WORD,DESCRIPTOR *);
  42. int SetDescriptor(WORD,DESCRIPTOR *);
  43. int GetExceptionVektor(BYTE,WORD *,WORD *);
  44. int SetExceptionVektor(BYTE,WORD,WORD);
  45. int GetPMinterruptVector(BYTE,WORD *,WORD *);
  46. int SetPMinterruptVektor(BYTE,WORD,WORD);
  47. void getfreeinfo(FREEMEMINFO *);
  48. void printfreeinfo(FREEMEMINFO *);
  49. DWORD GlobalAlloc(DWORD,DWORD *);
  50. int GlobalFree(DWORD);
  51. int LockLinRegion(DWORD,DWORD);
  52. int UnlockLinRegion(DWORD,DWORD);
  53. void Yield(void);
  54. DWORD lsl(WORD);
  55. WORD lsl16(WORD);
  56. WORD lar(WORD);
  57. WORD verr(WORD);
  58. WORD verw(WORD);
  59. void sgdt(GDTR *);
  60. void sidt(GDTR *);
  61. WORD sldt(void);
  62. WORD str(void);
  63. void far * incfp(void far *);
  64. void far * decfp(void far *);
  65. void farcopy(void far *, void far *,DWORD);
  66. void printdescriptor(DESCRIPTOR);
  67. void far * morepages(WORD);
  68. void far *extmalloc(DWORD);
  69. void extfree(void far *);
  70.